﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

using System.IO;
using System.Xml.Linq;
using Dicom.Data;
using Dicom;

namespace Prowess.OIS.DataAccess.XML
{
    public class XmlGenerate
    {
        private XDocument theDoc;        
        public XmlGenerate()
        {
            theDoc = new XDocument();            
        }
        public void WriteXMLFile(String fileName)
        {

            theDoc.Save(fileName);
            theDoc = null;

        }
        public void GenerateXMLFormat(String fileName)
        {
            DicomFileFormat ff = new DicomFileFormat();
            ff.Load(fileName, DicomReadOptions.Default);
            theDoc = XDicom.ToXML(ff.Dataset, XDicomOptions.None);
            ff = null;
        }        
    }
}
